//
//  TDPieChartViewController.m
//  iosf
//
//  Created by Yuan Ye on 12-4-5.
//  Copyright (c) 2012年 Neusoft Corporation. All rights reserved.
//

#import "TDPieChartViewController.h"
#import "TDPieChart.h"
@interface TDPieChartViewController ()

@end

@implementation TDPieChartViewController
@synthesize pieChart=_pieChart;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self.pieChart setDataSource:self];
    self.pieChart.backgroundColor=RGBCOLOR(255, 0, 0);
    NSLog(@"%@",self.pieChart.dataSource);
    // Do any additional setup after loading the view from its nib.
}

-(void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
    [self.pieChart reloadData];
}
-(NSUInteger)numberOfSlicesInPieChart:(TDPieChart *)pieChart{
    NIDPRINTMETHODNAME();
    return 5;
}
-(CGFloat)pieChart:(TDPieChart *)pieChart valueForSliceAtIndex:(NSUInteger)index{
    NIDPRINTMETHODNAME();
    return 100;
}
-(UIColor *)pieChart:(TDPieChart *)pieChart colorForSliceAtIndex:(NSUInteger)index{
    return RGBCOLOR(125, 125, 125);
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
	return YES;
}

@end
